/**
 * 在react18版本之前使用的是createStore方法来创建store，但是到了react18版本之后
 * 使用legacy_createStore方法去创建store,为了方便其间，可以取一个别名
 * createStore函数参数是reducer方法,reducer方法有两个参数，参数1是state,参数2是action对象
 */
import {legacy_createStore as createStore,combineReducers,applyMiddleware} from 'redux'
import {composeWithDevTools} from 'redux-devtools-extension'
import counterReducer from './reducers/counterReducer'
import shopcartReducer from './reducers/shopcartReducer'
import logger from 'redux-logger'
import {thunk} from 'redux-thunk'
const rootReducer=combineReducers({
    counterKey:counterReducer,
    shopcartKey:shopcartReducer
})
const store=createStore(rootReducer,composeWithDevTools(applyMiddleware(thunk)))
export default store